package com.libs.utils;

import com.libs.sys.service.SeatService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

public class SeatUtils {
    @Autowired
    private SeatService seatService;
    private static SeatUtils seatUtils;

    @PostConstruct
    public void init() {
        seatUtils = this;
        seatUtils.seatService = this.seatService;
    }

    public static void main(String[] args) throws Exception {
//        List<String> list = new ArrayList<>();
//        String url = "https://lib-seat.chu.edu.cn/ClientWeb/pro/ajax/device.aspx?byType=devcls&classkind=8&display=fp&md=d&room_id=100455382&purpose=&selectOpenAty=&cld_name=default&date=2021-09-06&fr_start=11%3A53&fr_end=17%3A53&act=get_rsv_sta&_=1630900401150";
//        CloseableHttpResponse getRes = HttpClientConn.getGetRes(url, true, HttpClientConn.getHttpClient());
//        String body = EntityUtils.toString(getRes.getEntity());
//        JSONObject jsonObject = JSONObject.parseObject(body);
//        JSONArray data= jsonObject.getJSONArray("data");
//        for (int i = 0; i < data.size(); i++) {
//            JSONObject d = JSONObject.parseObject(data.get(i).toString());
//            System.out.println(d.getString("devId")+d.getString("devName"));
////            list.add(d.getString("devId"));
//            seatUtils.seatService.add(new Seat(d.getString("devId"),1));
//        }

    }
}
